﻿using CommonUtility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication
{
    public partial class TimeOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string message = Common.ToString(Request["message"]);
            switch (message)
            {
                case "noright":
                    //lblMessage.Text = "您没有权限使用该系统。";
                    lblMessage.Text = "Access denied!";
                    break;
                case "timeout":
                    //lblMessage.Text = "您未登录或者登录超时. 请 <a href='#' onclick='Login()'><b>登录</b></a> 后使用";
                    lblMessage.Text = "You are not logged in or login timeout. Please <a href='#' onclick='Login()'><b>log in</b></a>";
                    break;
            }

            SystemConfig config = new SystemConfig();
            string url = config.Url;
            string script = "function Login(){top.document.location='" + url + "/Login.aspx';}";
            System.Web.UI.ClientScriptManager csm = Page.ClientScript;
            csm.RegisterStartupScript(this.GetType(), "__login", script, true);
        }
    }
}